<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<div id="createWizard" class="wizard box tabbedBox no-border">

	<form:form commandName="model" cssClass="validate" id="changeForm"
		action="change/change/save">
		<input id="id" name="id" type="hidden" value="${model.id }">
		<table id="riskRankSelectData" style="display:none">
			<tr>
				<td id="risk0_td1">1-9</td>
				<td id="risk0_td2">很高</td>
			</tr>
			<tr>
				<td id="risk0_td1">7-13</td>
				<td id="risk0_td2">高</td>
			</tr>
			<tr>
				<td id="risk1_td1">14-18</td>
				<td id="risk1_td2">中</td>
			</tr>
			<tr>
				<td id="risk2_td1">18-100</td>
				<td id="risk2_td2">低</td>
			</tr>
		</table>
		<div class="header">
			<ul class="steps">
				<li><a class="current" href="#wiz_tab1">1、基本信息</a>
				</li>
				<li><a href="#wiz_tab2">2、配置项清单</a>
				</li>
				<li><a href="#wiz_tab3">3、风险分析</a>
				</li>
				<!-- <li><a href="#wiz_tab4">4、发布信息</a>
				</li> -->
			</ul>
		</div>

		<div class="content tabbed" style="padding:0">

			<div id="wiz_tab1">
				<table class="form-table">
					<tr>

						<td class="td1">变更类型：</td>
						<td class="td2"><form:select path="changeType"
								cssClass="required" items="${types }" itemValue="name"
								itemLabel="name" />
						</td>
						<td class="td1">请求日期：</td>
						<td class="td2"><form:input path="requestDate"
								cssClass="required" type="datetime" />
						</td>
					</tr>
					<%-- <tr id="changeTypeMemoDefine" style="display:none">
						<td class="td1" colspan="1">紧急变更定义：</td>
						<td class="td2" colspan="3"><span style="color:green">生产线停线、生产或销售受到严重影响或1个以上部门办公受到影响，需要尽快实施的变更。<span>
						</td>
					</tr>
					<tr style="display:none" id="changeType2Memo">
						<td class="td1">紧急变更情况说明：</td>
						<td class="td2" colspan="3"><input id="memo" name="memo"
							value="${model.memo }" class="required" type="text"
							maxlength="200" style="width:80%"></td>
					</tr> --%>

					<tr>
						<td class="td1">请求人：</td>
						<td class="td2"><form:hidden path="requester" /> <isperp:departmentUser
								displayValue="${model.requesterName }"
								valueControlId="requester" id="requesterName"
								name="requesterName" displayValueCssClass="required"></isperp:departmentUser>
						</td>
						
						<td class="td1">优先级：</td>
						<td class="td2"><isperp:dictListSelector id="priorityName"
								items="${prioritys }" name="priorityName" hasEmptyValue="false"
								selectedValue="${model.priorityName }"
								onchangeFunc="resetPriorityName()">
							</isperp:dictListSelector>

						
					</tr>

					

					<tr>
						<td class="td1">选择项目：</td>
						<td class="td2" colspan="3"><form:select path="projectId"
								cssClass="required search" items="${projects }" itemValue="id"
								itemLabel="name" data-width="155px" /></td>
					<tr>
					<tr>
						<td class="td1">分类：</td>
						<td class="td2"><form:hidden path="chgCategoryId" /> <isperp:treeSelector
								url="incident/category/getTree" id="chgCategorySelector"
								name="chgCategoryName" displayValue="${model.chgCategoryName }"
								valueControlId="chgCategoryId" displayValueCssClass="required"></isperp:treeSelector>
						</td>
						<%-- <td class="td1">实施方式：</td>
						<td class="td2"><isperp:dictSelector
								typeCode="CHANGE_SOLUTIONWAY" name="solutionWay"
								id="solutionWay" hasEmptyValue="false" dictCssClass="required"
								selectedValue="${model.solutionWay }"></isperp:dictSelector>
						</td> --%>
					</tr>

					<tr>
						<td class="td1">标题：</td>
						<td class="td2" colspan="3"><input id="changeTitle"
							name="title" value="${model.title }" class="required" type="text"
							maxlength="200" style="width:80%"></td>
					</tr>
					<tr>
						<td class="td1">原因：</td>
						<td class="td2" colspan="3"><input id="reasonAnalysis"
							name="reasonAnalysis" value="${model.reasonAnalysis }"
							class="required" type="text" maxlength="200" style="width:80%">
						</td>
					</tr>
					<tr>
						<td class="td1">变更描述：</td>
						<td class="td2" colspan="3"><textarea id="changeDescription"
								class="required" name="description">${model.description }</textarea>
						</td>
					</tr>
					<tr>
						<td class="td1"><label>资料准备：</label></td>
						<td class="td2" colspan="3">

							<div id="container">
								<isperp:uploader sourceId="${model.id }" hidetips="true"
									id="changeFiles"></isperp:uploader>
								请上传附件【操作手顺】、【TimeChart】、【回滚计划】、【人员体制】、【测试报告】
							</div>
							<div id="filelist"></div></td>
					</tr>
					<tr>
						<td class="td1">计划开始日期：</td>
						<td class="td2"><input id="planStartTime"
							name="planStartTime" type="datetime" class="required"
							value="${model.planStartTime}" pattern="yyyy-MM-dd" />
						</td>

						<td class="td1">计划截止日期：</td>
						<td class="td2"><input id="planEndTime" name="planEndTime"
							class="required" type="datetime" pattern="yyyy-MM-dd"
							value="${model.planEndTime }"></td>
					</tr>

					 <%-- <tr>
						<td class="td2" colspan="4">
							<div class="header">
								<h3>处理人</h3>
							</div></td>
					</tr>
					<tr>
					   
					</tr> 
					 <tr>
					    <td class="td1">处理人员：</td>
						<td class="td2" colspan="3"><form:hidden path="executer" /> <isperp:departmentUser
								displayValue="${model.executerName }"
								valueControlId="executer" id="executerName"
								name="executerName" displayValueCssClass="required"></isperp:departmentUser>
						</td>
					</tr> --%>
					<%-- <tr>
					   <td class="td1">变更委员会：</td>
						<td class="td2" colspan="3"><form:hidden path="approver" /> <isperp:departmentUser
								idFieldName="name" displayValue="${model.approverName }"
								valueControlId="approver" multiselect="true" id="approverName"
								name="approverName" displayValueCssClass="widthDu required"></isperp:departmentUser>
						</td>
						
					</tr> --%>



				</table>
				<div class="header">
					<h3>关联流程</h3>
				</div>
				<isperp:processRelation businessKey="${model.id }" readonly="false"
					processKey="changeProcess" projectIdControl="projectId"></isperp:processRelation>
			</div>
			<div id="wiz_tab2">
				<table class="form-table">

					<%-- <tr>
						<td class="td1">技术服务目录：<input type="hidden"
							id="standardcosttime" name="standardcosttime"
							value="${standardcosttime}">
						</td>
						<td class="td2" colspan="3"><input type="hidden"
							id="serviceCategoryId" name="serviceCategoryId"
							value="${model.serviceCategoryId }" />

							<div style="display:none">
								<isperp:changeSort afterSelected="getTecServiceRowData(row)"
									displayValue="${model.serviceCategoryName }" multiselect="true"
									displayValueStyle="width:249px;"
									displayValueCssClass="required" idFieldName="id"
									valueControlId="serviceCategoryId" id="serviceCategoryName"
									name="serviceCategoryName"></isperp:changeSort>
							</div> <input type="button" value="选择技术服务目录" class="button nui-mainbtn"
							onclick="$('#serviceCategoryNameDialog').wijdialog('open');"><span
							style='color:red'>*</span> <font color="blue">必选 </font></td>

					</tr>
					<tr id="tr_tecServiceSelect">
						<td colspan="4"><isperp:tecServiceList></isperp:tecServiceList>
							<div>
								<table id="tb_tecServiceSelect" class='gridtable'
									style="width:40%;margin-left:25px;">


								</table>
							</div></td>
					</tr> --%>

					<tr id="assetTr" style="display:none;">
						<td class="td1">关联资产：</td>
						<td class="td2" colspan="3"><input type="text"
							id="newChangeSelectCi" value="true"> <isperp:ciListSelector
								id="ciSelector" afterSelected="checkIfChangeFlow(ids);"
								relationType="changeProcess" relationId="${model.id }"
								listUrl="configuration/ciUseRelation/listChangeCi"
								saveUrl="configuration/ciUseRelation/saveWithCi"></isperp:ciListSelector>
						</td>
					</tr>

					<isperp:changeRelateCi viewOnly="false" changeId="${model.id }"></isperp:changeRelateCi>
				</table>

			</div>
			<div id="wiz_tab3">
				<table class="form-table">
					<tr>
						<td class="td1">影响：</td>
						<td class="td2" colspan="3"><textarea id="effectAnalysis"
								class="required" name="effectAnalysis">${model.effectAnalysis }</textarea>
						</td>
					</tr>
					<tr>
						<td class="td1">风险评估：</td>
						<td class="td2" colspan="3"><textarea id="riskEvaluate"
								name="riskEvaluate" class="required">${model.riskEvaluate }</textarea>
						</td>
					</tr>
					<tr>
						<td class="td1">风险等级：</td>
						<td class="td2" colspan="3"><label id="lbRiskLevel"></label>
						</td>
					</tr>
					<tr>
						<td colspan="4"><isperp:selectRisk changeId="${model.id }"
								afterSelected="setRiskLevel(returnObj)"></isperp:selectRisk></td>
						<input type="hidden" name="riskRank" value="${model.riskRank }"
							onclick="openRiskElementWin();" id="riskRankTxt" class="">

					</tr>


				</table>
			</div>
			<%-- <div id="wiz_tab4">
				<table class="form-table">

					<tr>
						<td class="td1">发布内容：</td>
						<td class="td2" colspan="4"><textarea id="publishDescription"
								class="required" name="publishDescription">${model.publishDescription}</textarea>
						</td>
					</tr>

					<tr>
						<td class="td1">计划开始日期：</td>
						<td class="td2"><input id="planStartTime"
							name="planStartTime" type="datetime" class="required"
							value="${model.planStartTime}" pattern="yyyy-MM-dd" />
						</td>

						<td class="td1">计划截止日期：</td>
						<td class="td2"><input id="planEndTime" name="planEndTime"
							class="required" type="datetime" pattern="yyyy-MM-dd"
							value="${model.planEndTime }"></td>
					</tr>

					<tr>
						<td class="td1">发送对象：</td>
						<td class="td2" colspan="3" style="width:100%"><isperp:inputEmail
								id="mailToGird" vid="tmp1" gridId="ChangeMailToGird"
								sentType="chgMailTo"></isperp:inputEmail></td>
					</tr>
					<tr>
						<td class="td1">抄送对象：</td>
						<td class="td2" colspan="3"><isperp:inputEmail
								id="mailCcToGird" vid="tmp2" gridId="ChangeMailCcToGird"
								sentType="chgMailCcTo"></isperp:inputEmail></td>
					</tr>
				</table>
			</div> --%>
	</form:form>


</div>
<isperp:wizButtonList buttonListId="bpmConfigWizardBtns"
	hiddenFinishButton="true">
	<div class="right finish">
		<isperp:processButtons processKey="changeProcess"
			beforeSubmit="function(name){return check(name);}"
			processId="${model.processId }" businessKey="${model.id }"
			formId="changeForm"></isperp:processButtons>
	</div>
</isperp:wizButtonList>

<script type="text/javascript">
	function submitChange() {
		isperp.showLoading({
			onThisWindow : true
		});
		var res = isperp.submitForm({
			formId : "ChangeForm",
			data : {},
			success : function(responseText) {
				alert(responseText);
			}
		});
		if (res) {

			isperp.hideLoading({
				onThisWindow : true
			});
		}
	}

	var $wizCreate = isperp.wizard({
		wizardId : "createWizard"
	});

	var createWizard_Event1 = function(index, obj) {
		 var result = $("#changeForm").valid();
		if (!result) {
			return false;
		}else
		{
		  return true;
		}
		/*var fc = $("#changeFilesFiles").html();
		if (fc == "") {
			isperp.confirmAlert("请上传相关附件!", {
				yes : function() {
					// $("#pickfiles").focus();
					changeFiles.openUploaderDialog();
				}
			});
			return false;
		} else {
			return true;
		} */
	};

	var createWizard_Event2 = function(index, obj) {
		var result = $("#changeForm").valid();
		if (!result) {
			return false;
		}
		if ($("#serviceCategoryId").val() == "") {
			isperp.alert("请选择技术服务目录！");
			return false;
		}

	};

	var createWizard_Event3 = function(index, obj) {
		/* var result = $("#changeForm").valid();
		if (!result) {
			return false;
		}
		//风险分析获取选择的项
		var returnObj = getSelectIds();
		if (returnObj == false) {
			return false;
		} else {
			setAnalysis(returnObj);
		} */
	};
	/* var createWizard_Event4 = function(index, obj) {
		var result = $("#changeForm").valid();
		if (!result) {
			return false;
		}
		var ChangeMailToGirdObj = $("#ChangeMailToGird").jqGrid("getRowData");
		if (ChangeMailToGirdObj.length > 0) {
			return true;
		} else {
			isperp.alert("请添加发送对象！");
			return false;

		}
	}; */
//-->
</script>
<script type="text/javascript">
	$(function() {
		selectChangeType();
	});
	function checkIfChangeFlow(ids) {
		createChangeCiList(ids);
	}
	function selectChangeType() {
		var changeType = $("#changeType").val();
		if (changeType == "紧急变更") {
			$("#approvers_table").hide();
			$("#approvers_div").hide();
			//
			$("#changeType2Memo input").show();
			$("#changeType2Memo").show();
			$("#changeTypeMemoDefine").show();

		} else {
			$("#approvers_table").show();
			$("#approvers_div").show();

			$("#changeType2Memo input").hide();
			$("#changeType2Memo").hide();
			$("#changeTypeMemoDefine").hide();
		}
	}
	function getTecServiceRowData(rowObjects) {
		var standarTime = 0;
		var solutionWay = $("#solutionWay").val();
		var standarTimesLocal = rowObjects[4];
		var standarTimesRemote = rowObjects[5];
		var standarTimesTemp = "";
		/* if (solutionWay == "现场") {
			standarTimesTemp = standarTimesLocal;
		} else if (solutionWay == "远程") {
			standarTimesTemp = standarTimesRemote;
		} */
		standarTimesTemp = standarTimesLocal;

		if (rowObjects[2] == "" || rowObjects[2] == null)
			return false;

		$("#tempBearApproverIds").val(rowObjects[2]);
		$("#tempBearApproverNames").val(rowObjects[3]);
		setLeaderApprovers();
		if ($("#changeCiCon").text() == "") {
			isperp.confirmAlert("如果有需要变更的配置项，请点击【确定】选择！", {
				yes : function() {
					selectCi();
				}
			});
		}

		var tecServiceNames = rowObjects[1];
		var tecServiceResponseManNames = rowObjects[7];
		var tecServiceStandardTimes = standarTimesTemp;
		var tecServiceNamesArr = tecServiceNames.split(",");
		var tecServiceResponseManNamesArr = tecServiceResponseManNames.split("-");
		var tecServiceStandardTimesArr = ("" + tecServiceStandardTimes).split(",");

		var trStr = "";
		$("#tb_tecServiceSelect").html("<tr><th style='width:30%'>服务名称</th><th style='width:30%'>责任人-IS担当</th><th>标准工时（分钟）</th></tr>");
		for ( var i = 0; i < tecServiceNamesArr.length; i++) {
			standarTime += parseInt(tecServiceStandardTimesArr[i]);
			var time = tecServiceStandardTimesArr[i] == 0 ? '未定' : tecServiceStandardTimesArr[i];
			trSrr = "<tr><td>" + tecServiceNamesArr[i] + "</td><td>" + tecServiceResponseManNamesArr[i] + "</td><td>" + time + "</td></tr>";
			$("#tb_tecServiceSelect").append(trSrr);
		}
		$("#standardcosttime").val(standarTime);
		$("#tb_tecServiceSelect_ex").hide();
	}
	//获取担当当前部门或父级部门的科长系长
	function getLeaderByBearName(bearNames) {
		var result = null;
		$.ajax({
			async : false,
			url : "app/user/getUserDepartmentLeaderByPositionName",
			data : {
				position : '系长,科长,系长代行,科长代行',
				names : bearNames
			},
			success : function(data) {
				//alert(data);
				result = data;
			}
		});
		return result;
	}
	function setLeaderApprovers() {
		var departmentApproverIds = "";
		var departmentApproverNames = "";
		var groupApproverIds = "";
		var groupApproverNames = "";
		//技术服务目录担当
		var bearId_temp = $("#tempBearApproverIds").val();
		var bearName_temp = $("#tempBearApproverNames").val();
		//所属系统主担当
		var bearId_mainBear = $("#bearManId").val();
		var bearName_mainBear = $("#bearManName").val();
		//担当合集
		var bearIdTotal = "";
		var bearNameTotal = "";
		//技术服务目录担当排除主担当
		var bearApproverIds = "";
		var bearApproverNames = "";
		//--------获取相关担当--------//
		if (bearId_temp != "" && bearId_mainBear != "") {
			bearIdTotal = bearId_temp + "," + bearId_mainBear;
			bearNameTotal = bearName_temp + "," + bearName_mainBear;
		} else if (bearId_temp != "") {
			bearIdTotal = bearId_temp;
			bearNameTotal = bearName_temp;
		} else {
			bearIdTotal = bearId_mainBear;
			bearNameTotal = bearName_mainBear;
		}
		if (bearIdTotal == "")
			return false;
		//----------------------//
		var bearIdTempArr = bearId_temp.split(",");
		var bearNameTempArr = bearName_temp.split(",");

		for ( var i = 0; i < bearIdTempArr.length; i++) {
			if (bearIdTempArr[i] != bearId_mainBear)
				bearApproverIds += bearIdTempArr[i] + ",";
		}
		for ( var i = 0; i < bearNameTempArr.length; i++) {
			if (bearNameTempArr[i] != bearName_mainBear)
				bearApproverNames += bearNameTempArr[i] + ",";
		}
		if (bearApproverIds != "") {
			bearApproverIds = bearApproverIds.substring(0, bearApproverIds.length - 1);
			bearApproverNames = bearApproverNames.substring(0, bearApproverNames.length - 1);
		}

		$("#bearApproverIds").val(bearApproverIds);
		$("#bearApproverNames").val(bearApproverNames);
		//alert(bearApproverNames);
		if (bearApproverIds == "") {
			$("#approveCount1").val(0);
		} else {
			$("#approveCount1").val(bearApproverIds.split(',').length);
		}

		$("#td_bearApproverNames_span").text($("#bearApproverNames").val());
		if ($("#approveCount1").val() == 0) {
			//$("#tr_bearApproverNames").hide();
			$("#td_bearApproverNames_span").text(bearName_mainBear);
		} else {
			$("#tr_bearApproverNames").show();
		}

		//---------------------相关担当的系长科长-------------
		var result = getLeaderByBearName(bearIdTotal);
		var positionTotal = "";
		for ( var i = 0; i < result.length; i++) {
			positionTotal += result[i].position + ",";
			if (result[i].position.indexOf("系长") > -1) {
				departmentApproverIds += result[i].name + ",";
				departmentApproverNames += result[i].fullname + ",";
			} else if (result[i].position.indexOf("科长") > -1) {
				groupApproverIds += result[i].name + ",";
				groupApproverNames += result[i].fullname + ",";
			}
		}
		departmentApproverIds = deleteLastChar(departmentApproverIds);
		departmentApproverNames = deleteLastChar(departmentApproverNames);
		groupApproverIds = deleteLastChar(groupApproverIds);
		groupApproverNames = deleteLastChar(groupApproverNames);
		$("#departmentApproverIds").val(departmentApproverIds);
		$("#departmentApproverNames").val(departmentApproverNames);
		$("#groupApproverIds").val(groupApproverIds);
		$("#groupApproverNames").val(groupApproverNames);
		$("#approveCount2").val(departmentApproverIds.split(',').length);
		$("#approveCount3").val(groupApproverIds.split(',').length);
		$("#td_departmentApproverNames").text(departmentApproverNames);
		$("#td_groupApproverNames").text(groupApproverNames);
		//---------------------相关担当的系长科长---------------
	}

	function deleteLastChar(str) {
		return str.substring(0, str.length - 1);
	}

	function setRiskLevel(returnObj) {
		var tids = returnObj.ids;//选择的id序列，逗号隔开
		var tvals = returnObj.tvals;//选择的系数序列，逗号隔开
		var count = tids.split(',').length;
		var countInfArr = tvals.split(',');
		var countInf = 0;
		for ( var i = 0; i < countInfArr.length; i++) {
			countInf += parseInt(countInfArr[i]);
		}
		$("#riskRankSelectData tr").each(function() {
			var valueScope = $(this).find("td").eq(0).text();
			var valueScope_low = valueScope.split('-')[0];
			var valueScope_hig = valueScope.split('-')[1];
			if (countInf >= valueScope_low && countInf <= valueScope_hig) {
				$("#riskRankTxt").val($(this).find("td").eq(1).text());
				$("#lbRiskLevel").text($("#riskRankTxt").val());
			}
		});
	}

	function setAnalysis(obj) {
		var tids = obj.ids;//选择的id序列，逗号隔开
		var tvals = obj.tvals;//选择的系数序列，逗号隔开
		var count = tids.split(',').length;
		var countInfArr = tvals.split(',');
		var countInf = 0;
		for ( var i = 0; i < countInfArr.length; i++) {
			countInf += parseInt(countInfArr[i]);
		}
		var id = '${model.id }';
		//数据库插入关系chg_element_relation
		$.ajax({
			async : false,
			url : "change/change/updateChgElementRelation?id=" + id + "&tids=" + tids + "&ty=chgRiskElement",
			success : function(data) {

			}
		});
	}
	function choseRiskC() {
		isperp.openDialog({
			title : "查看消息",
			contentUrl : "change/change/riskCheckList"
		});
	}
	function resetPriorityName() {
		var $urgencyName = $("#urgencyName option:selected"), urgencyNameCode = parseInt($urgencyName.data("code"));
		var $effectName = $("#effectName option:selected"), effectNameCode = parseInt($effectName.data("code"));

		var ueVal = urgencyNameCode + effectNameCode;

		var $priorityName = $("#priorityName"), $priorityNameOptions = $("#priorityName option");

		for ( var i = 0; i < $priorityNameOptions.length; i++) {
			var $item = $($priorityNameOptions[i]), code = parseInt($item.data("code"));

			if (ueVal >= code) {
				$priorityName.val($item.val());
				$("#priorityName").trigger("chosen:updated");
				return;
			}
		}

	}

	function openRiskElementWin() {
		isperp.openDialog({
			id : "abkkDialog",
			onThisWindow : true,
			contentUrl : 'change/riskElement/selectRiskEdit?pcontrolid=appMessageRemindGrid',
			title : "风险因素",
			buttons : [ {
				text : "确定",
				"class" : 'nui-mainbtn',
				click : function() {
					var returnObj = $("#abkkDialog").find("iframe")[0].contentWindow.getSelectIds();
					setAnalysis(returnObj);
					$(this).wijdialog("close");
				}
			}, {
				text : "关闭",
				"class" : 'grey',
				click : function() {
					$(this).wijdialog("close");
				}
			} ]
		});
	}

	//选择事件分类带出二线担当 
	function clearCategory() {
		$("#chgCategorySelector").val("");
		$("#chgCategoryId").val("");
		$("#chgCategoryName").val("");
		$("#bearManId").val("");
		$("#bearManName").val("");
	}

	function changeCategory(id) {
		if (id) {
			searchCategoryDandang(id);
		}
	}
	function searchCategoryDandang(categoryId) {
		$.getJSON("incident/categoryRelamembers/findRelaAppUserByCategoryIdAndRole?categoryId=" + categoryId, function(data) {
			$("#bearManId").val("");
			$("#bearManName").val("");
			if (data[0]) {
				$(data).each(function(index, item) {
					$("#applicationBearId").val(item.application_bear_id);
					$("#applicationBearName").val(item.application_bear_name);
					$("#basisBearId").val(item.basis_bear_id);
					$("#basisBearName").val(item.basis_bear_name);

					var bearType = "";
					if (bearType == "")
						bearType = 1;
					$("#bearType_" + bearType).click();
					changeIsBear(bearType);
				});
			}
		});
	}
	function changeIsBear(v) {
		if (v == 1) {
			$("#bearManId").val($("#applicationBearId").val());
			$("#bearManName").val($("#applicationBearName").val());
		} else {
			$("#bearManId").val($("#basisBearId").val());
			$("#bearManName").val($("#basisBearName").val());
		}
		setLeaderApprovers();
	}
	function check(name) {
		var result = $("#changeForm").valid();
		if (!result) {
			return false;
		}
		//风险分析获取选择的项
		var returnObj = getSelectIds();
		if (returnObj == false) {
			return false;
		} else {
			setAnalysis(returnObj);
			return true;
		}
	}
</script>
